package snafu.implementation.objects.pit;

import java.awt.Color;

import snafu.framework.actions.AbstractAction;
import snafu.framework.actions.AbstractReaction;
import snafu.framework.objects.WorldObjectItself;
import snafu.framework.states.StateItself;
import snafu.framework.view.Access;
import snafu.implementation.actions.kill.KillIntentionItself;
import snafu.implementation.objects.wind.WindItself;
import snafu.implementation.states.literals.color.ColorLiteralItself;
import snafu.implementation.states.literals.depth.DepthLiteralItself;
import snafu.implementation.states.literals.surround.SurroundLiteralItself;
import snafu.implementation.states.literals.walk.WalkableLiteralItself;

public class PitItself extends WorldObjectItself<PitView> implements Pit {

	@Override
	public PitView createView(Access access) {
		return new PitView(access, this);
	}

	@Override
	public StateItself getInitialState() {
		StateItself state = new StateItself();
		state.addLiteral(new ColorLiteralItself(Color.BLACK, Access.PUBLIC));
		state.addLiteral(new DepthLiteralItself(3 , Access.PUBLIC));
		state.addLiteral(new WalkableLiteralItself(true, Access.PUBLIC));
		state.addLiteral(new SurroundLiteralItself(new WindItself(), 1, Access.PUBLIC));
		
		return state;
	}
	
	@Override
	public AbstractReaction react(AbstractAction action) {
		return new AbstractReaction(this, action, new KillIntentionItself(Access.PRIVATE));
	}

	@Override
	public String output() {
		return "Pit";
	}
}
